<!DOCTYPE HTML>
<html lang="en">
<head>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2011. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<meta charset="utf-8">
<link rel="STYLESHEET" href="../book.css" type="text/css">
<script src="PLUGINS_ROOT/org.eclipse.help/livehelp.js"></script>
<title>Defining a product status handler</title>
</head>
<body>

<h2>Defining a Product Status Handler</h2>

<p> 
The <a href="../reference/api/org/eclipse/ui/statushandlers/AbstractStatusHandler.html"><b>AbstractStatusHandler</b></a> 
class and the <b><a href="../reference/extension-points/org_eclipse_ui_statusHandlers.html">org.eclipse.ui.statusHandlers</a></b> 
extension point make up the generic mechanism that can be used to customize 
problem handling for the given product. The main purpose of this extension is 
to define status handlers (which extends <a href="../reference/api/org/eclipse/ui/statushandlers/AbstractStatusHandler.html"><b>AbstractStatusHandler</b></a>) 
and to specify the binding between a product and a status handler. For example, 
the following contribution defines a hypothetical status handler to be used 
by the workbench:</p> 

<pre>
   &lt;extension point="org.eclipse.ui.statusHandlers"&gt; 
      &lt;statusHandler
            class="org.eclipse.ui.statushandlers.SampleStatusHandler"
            id="sampleStatusHandler"/&gt;
      &lt;statusHandlerProductBinding
            handlerId="sampleStatusHandler"
            productId="productId"&gt;
      &lt;/introProductBinding&gt;
   &lt;/extension&gt; 
</pre>
<p>
This contribution first defines the status handler and assigns it the id "sampleStatusHandler".  It then binds this
handler to a product whose id is "productId". When the status handling facility is accessed first time, 
the class specified in the <b>class</b> attribute will be instantiated by the workbench and used for handling of
status or error occurred in the product.
</p>

<p>
The platform supplies its own <a href="../reference/api/org/eclipse/ui/statushandlers/AbstractStatusHandler.html"><b>AbstractStatusHandler</b></a>
implementation called <a href="../reference/api/org/eclipse/ui/statushandlers/WorkbenchErrorHandler.html"><b>WorkbenchErrorHandler</b></a>.
</p>

</body>
</html>
